package com.njtoyo.taxi.admin.rest.wrapper.data.chart;

import com.njtoyo.taxi.admin.library.common.Enum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@ApiModel("趋势图查询模型")
public class ChartQueryWrapper {
    @ApiModelProperty("地区ID")
    private Long cantonId;

    @ApiModelProperty("公司ID")
    private Long companyId;

    @ApiModelProperty("聚合类型，默认: day")
    private Enum.DateGroupType dateGroupType = Enum.DateGroupType.day;

    @ApiModelProperty("查询间隔,表示查询几个周期,默认: 10")
    @NotNull(message = "查询间隔")
    private Long interval = 10L;

    @ApiModelProperty("开始时间，精确到月，例如`2021-03`，dateGroupType为customize时必填")
    @DateTimeFormat(pattern = "yyyy-MM")
    private Date startTime;

    @ApiModelProperty("结束时间，精确到月，例如`2021-03`，dateGroupType为customize时必填")
    @DateTimeFormat(pattern = "yyyy-MM")
    private Date endTime;
}
